import lauout from '@/layout'

const router: CustomRoute[] = [
  // 第一个路由是固定的(不包含子路由)
  {
    name: 'CBC',
    path: '/CBC',
    redirect: '/CBC/dataOverview',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '数据概览',
      path: '/CBC',
      target: '0',
      img: 'dataOverview',
      activeImg: 'dataOverview-active'
    },
    children: [
      {
        name: 'CBC-dataOverview',
        path: 'dataOverview',
        component: () => import('../views/dataOverview'),
        meta: {
          title: '数据概览',
          path: '/CBC/home',
          hidden: true,
          target: '0-0',
          parentTarget: '0',
          keepAlive: true
        },
        children: [
          {
            name: 'CBC-dataOverview-singleDevParams',
            path: 'singleDevParams',
            component: () => import('../views/singleDevParams'),
            meta: {
              title: '设备数据',
              path: '/CBC/dataOverview/singleDevParams',
              hidden: true,
              parentTarget: '0-0',
              target: '0-0-0'
            },
            children: [
              {
                name: 'CBC-dataOverview-singleParam',
                path: 'singleParam',
                component: () => import('../views/singleParam'),
                meta: {
                  title: '参数详情',
                  path: '/CBC/dataOverview/singleParam',
                  hidden: true,
                  parentTarget: '0-0-0',
                  target: '0-0-0-0'
                }
              }
            ]
          }
        ]
      }
    ]
  },
  {
    name: 'historicalData',
    path: '/historicalData',
    redirect: '/historicalData/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '历史数据',
      path: '/historicalData',
      target: '1'
    },
    children: [
      {
        name: 'historicalData-home',
        path: 'home',
        component: () => import('../views/historicalData/index.vue'),
        meta: {
          title: '历史数据',
          path: '/historicalData/home',
          // parentName: 'alarmManagement',
          // parentPath: '/alarmManagement',
          parentTarget: '1',
          target: '1-0'
        }
      }
    ]
  },
  {
    name: 'alarmManagement',
    path: '/alarmManagement',
    redirect: '/alarmManagement/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '报警管理',
      path: '/alarmManagement',
      target: '2'
    },
    children: [
      {
        name: 'alarmManagement-home',
        path: 'home',
        component: () => import('../views/alarmManagement'),
        meta: {
          title: '报警管理',
          path: '/alarmManagement/home',
          // parentName: 'alarmManagement',
          // parentPath: '/alarmManagement',
          parentTarget: '2',
          target: '2-0'
        }
      }
    ]
  },

  {
    name: 'exceptionManagement',
    path: '/exceptionManagement',
    redirect: '/exceptionManagement/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '异常管理',
      path: '/exceptionManagement',
      target: '3'
    },
    children: [
      {
        name: 'exceptionManagement-home',
        path: 'home',
        component: () => import('../views/exceptionManagement'),
        meta: {
          title: '异常管理',
          path: '/exceptionManagement/home',
          // parentName: 'exceptionManagement',
          // parentPath: '/exceptionManagement',
          parentTarget: '3',
          target: '3-0'
        }
      }
    ]
  },
  {
    name: 'deviceManagement',
    path: '/deviceManagement',
    redirect: '/deviceManagement/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '设备管理',
      path: '/deviceManagement',
      target: '4',
      img: 'deviceManagement',
      activeImg: 'deviceManagement-active'
    },
    children: [
      {
        name: 'deviceManagement-home',
        path: 'home',
        component: () => import('../views/deviceManagement'),
        meta: {
          title: '设备管理',
          path: '/deviceManagement/home',
          // parentName: 'deviceManagement',
          // parentPath: '/deviceManagement',
          parentTarget: '4',
          hidden: true,
          target: '4-0',
          keepAlive: true
        },
        children: [
          {
            name: 'deviceManagement-home-deviceInfo',
            path: 'deviceInfo',
            component: () => import('../views/deviceInfo'),
            meta: {
              title: '设备信息',
              path: '/deviceManagement/home/deviceInfo',
              parentTarget: '4-0',
              target: '4-0-0',
              hidden: true
            }
          }
        ]
      }
    ]
  },
  {
    name: 'standardConfig',
    path: '/standardConfig',
    redirect: '/standardConfig/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '标准配置',
      path: '/standardConfig',
      target: '5'
    },
    children: [
      {
        name: 'standardConfig-home',
        path: 'home',
        component: () => import('../views/standardConfig'),
        meta: {
          title: '标准配置',
          path: '/standardConfig/home',
          // parentName: 'standardConfig',
          // parentPath: '/standardConfig',
          parentTarget: '5',
          target: '5-0'
        }
      }
    ]
  },
  {
    name: 'alarmConfig',
    path: '/alarmConfig',
    redirect: '/alarmConfig/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '报警配置',
      path: '/alarmConfig',
      target: '6'
    },
    children: [
      {
        name: 'alarmConfig-home',
        path: 'home',
        component: () => import('../views/alarmConfig'),
        meta: {
          title: '报警配置',
          path: '/alarmConfig/home',
          // parentName: 'alarmConfig',
          // parentPath: '/alarmConfig',
          parentTarget: '6',
          target: '6-0'
        }
      }
    ]
  },
  {
    name: 'dataCollection',
    path: '/dataCollection',
    redirect: '/dataCollection/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '数据采集',
      path: '/dataCollection',
      target: '7'
    },
    children: [
      {
        name: 'dataCollection-home',
        path: 'home',
        component: () => import('../views/dataCollection'),
        meta: {
          title: '数据采集',
          path: '/dataCollection/home',
          // parentName: 'dataCollection',
          // parentPath: '/dataCollection',
          parentTarget: '7',
          target: '7-0'
        }
      }
    ]
  },
  {
    name: 'deviceShare',
    path: '/deviceShare',
    redirect: '/deviceShare/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '设备分享',
      path: '/deviceShare',
      target: '8'
    },
    children: [
      {
        name: 'deviceShare-home',
        path: 'home',
        component: () => import('../views/deviceShare'),
        meta: {
          title: '设备分享',
          path: '/deviceShare/home',
          // parentName: 'deviceShare',
          // parentPath: '/deviceShare',
          parentTarget: '8',
          target: '8-0'
        }
      }
    ]
  },
  {
    name: 'devLog',
    path: '/devLog',
    redirect: '/devLog/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '设备日志',
      path: '/devLog',
      target: '9'
    },
    children: [
      {
        name: 'devLog-home',
        path: 'home',
        component: () => import('../views/devLog'),
        meta: {
          title: '设备日志',
          path: '/devLog/home',
          // parentName: 'devLog',
          // parentPath: '/devLog',
          parentTarget: '9',
          target: '9-0'
        }
      }
    ]
  },
  {
    name: 'faultFeedback',
    path: '/faultFeedback',
    redirect: '/faultFeedback/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '故障反馈',
      path: '/faultFeedback',
      target: '10',
      hidden: true
    },
    children: [
      {
        name: 'faultFeedback-home',
        path: 'home',
        component: () => import('../views/faultFeedback'),
        meta: {
          title: '故障反馈',
          path: '/faultFeedback/home',
          // parentName: 'faultFeedback',
          // parentPath: '/faultFeedback',
          parentTarget: '10',
          target: '10-0',
          hidden: true
        }
      }
    ]
  },
  {
    name: 'liveDataShow',
    path: '/liveDataShow',
    redirect: '/liveDataShow/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '实时数据',
      path: '/liveDataShow',
      target: '12'
    },
    children: [
      {
        name: 'liveDataShow-home',
        path: 'home',
        component: () => import('../views/liveDataShow'),
        meta: {
          title: '实时数据',
          path: '/liveDataShow/home',
          // parentName: 'userSetting',
          // parentPath: '/userSetting',
          parentTarget: '12',
          target: '12-0'
        }
      }
    ]
  },
  {
    name: 'interfaceDocument',
    path: '/interfaceDocument',
    redirect: '/interfaceDocument/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '数据接口',
      path: '/interfaceDocument',
      target: '13'
    },
    children: [
      {
        name: 'interfaceDocument-home',
        path: 'home',
        component: () => import('../views/interfaceDocument'),
        meta: {
          title: '数据接口',
          path: '/interfaceDocument/home',
          parentTarget: '13',
          target: '13-0'
        }
      }
    ]
  },
  {
    name: 'coordinateManagement',
    path: '/coordinateManagement',
    redirect: '/coordinateManagement/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      path: '/coordinateManagement',
      title: '坐标管理',
      target: '16',
      hidden: false
    },
    children: [
      {
        name: 'coordinateManagement-home',
        path: 'home',
        component: () => import('@/views/coordinateManagement/index.vue'),
        meta: {
          title: '坐标管理',
          path: '/coordinateManagement/home',
          // parentName: 'userSetting',
          // parentPath: '/userSetting',
          parentTarget: '16',
          target: '16-0',
          hidden: false
        }
      }
    ]
  },

  {
    name: 'userSetting',
    path: '/userSetting',
    redirect: '/userSetting/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '个人设置',
      path: '/userSetting',
      target: '30',
      img: 'userSetting',
      activeImg: 'userSetting-active'
    },
    children: [
      {
        name: 'userSetting-home',
        path: 'home',
        component: () => import('../views/userSetting'),
        meta: {
          title: '个人设置',
          path: '/userSetting/home',
          // parentName: 'userSetting',
          // parentPath: '/userSetting',
          parentTarget: '30',
          target: '30-0'
        },
        children: [
          {
            name: 'userSetting-home-aboutUs',
            path: 'aboutUs',
            component: () => import('../views/aboutUs'),
            meta: {
              title: '关于我们',
              path: '/userSetting/home/aboutUs',
              // parentName: 'userSetting',
              // parentPath: '/userSetting',
              parentTarget: '30-0',
              target: '30-0-0'
            }
          },
          {
            name: 'userSetting-home-contactUs',
            path: 'contactUs',
            component: () => import('../views/contactUs'),
            meta: {
              title: '关于我们',
              path: '/userSetting/home/contactUs',
              // parentName: 'userSetting',
              // parentPath: '/userSetting',
              parentTarget: '30-0',
              target: '30-0-1'
            }
          }
        ]
      }
    ]
  },
  {
    name: 'videoSurveillance',
    path: '/videoSurveillance',
    redirect: '/videoSurveillance/home',
    layout: true,
    component: () => import('../layout'),
    meta: {
      title: '监控摄像',
      path: '/videoSurveillance',
      target: '31'
    },
    children: [
      {
        name: 'videoSurveillance-home',
        path: 'home',
        component: () => import('../views/videoSurveillance'),
        meta: {
          title: '监控摄像',
          path: '/videoSurveillance/home',
          // parentName: 'userSetting',
          // parentPath: '/userSetting',
          parentTarget: '31',
          target: '31-0',
          keepAlive: true
        }
      }
    ]
  }
]
export default router
